package com.shkco.xbjcc.fallback;

import com.shkco.exception.GlobalExceptionCode;
import com.shkco.result.JSONResult;
import com.shkco.xbjcc.feign.MediaFileService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFileServiceFallbackFactory implements FallbackFactory<MediaFileService> {
    @Override
    public MediaFileService create(Throwable throwable) {
        return new MediaFileService() {

            @Override
            public JSONResult getMediaByCourseId(Long courseId) {
                return JSONResult.error(GlobalExceptionCode.ERROR);
            }
        };
    }
}
